﻿using System;

namespace SoundcloudSharp.Model
{
    /// <summary>
    /// SoundCloud track.
    /// </summary>
    public class Track 
    {
        #region Properties

        [JsonMapping("id", JsonMapping.MappingType.Primitive)]
        public int Id { get; set; }

        [JsonMapping("created_at", JsonMapping.MappingType.Primitive)]
        private string creationDate;

        public DateTime CreationDate { get { return (DateTime.Parse(creationDate)); } set { creationDate = value.ToString(); } }

        [JsonMapping("user_id", JsonMapping.MappingType.Primitive)]
        public int UserId { get; set; }

        [JsonMapping("duration", JsonMapping.MappingType.Primitive)]
        public int Duration { get; set; }

        [JsonMapping("commentable", JsonMapping.MappingType.Primitive)]
        public bool Commentable { get; set; }

        [JsonMapping("state", JsonMapping.MappingType.Primitive)]
        public string State { get; set; }

        [JsonMapping("sharing", JsonMapping.MappingType.Primitive)]
        public string Sharing { get; set; }

        [JsonMapping("tag_list", JsonMapping.MappingType.Primitive)]
        public string TagList { get; set; }

        [JsonMapping("permalink", JsonMapping.MappingType.Primitive)]
        public string Permalink { get; set; }

        [JsonMapping("description", JsonMapping.MappingType.Primitive)]
        public string Description { get; set; }

        [JsonMapping("streamable", JsonMapping.MappingType.Primitive)]
        public bool Streamable { get; set; }

        [JsonMapping("downloadable", JsonMapping.MappingType.Primitive)]
        public bool Downloadable { get; set; }

        [JsonMapping("genre", JsonMapping.MappingType.Primitive)]
        public string Genre { get; set; }

        [JsonMapping("release", JsonMapping.MappingType.Primitive)]
        public string Release { get; set; }

        [JsonMapping("purchase_url", JsonMapping.MappingType.Primitive)]
        public string PurchaseUrl { get; set; }

        [JsonMapping("label_id", JsonMapping.MappingType.Primitive)]
        public string LabelId { get; set; }

        [JsonMapping("label_name", JsonMapping.MappingType.Primitive)]
        public string LabelName { get; set; }

        [JsonMapping("isrc", JsonMapping.MappingType.Primitive)]
        public string Isrc { get; set; }

        [JsonMapping("video_url", JsonMapping.MappingType.Primitive)]
        public string VideoUrl { get; set; }

        [JsonMapping("track_type", JsonMapping.MappingType.Primitive)]
        public string TrackType { get; set; }

        [JsonMapping("key_signature", JsonMapping.MappingType.Primitive)]
        public string KeySignature { get; set; }

        [JsonMapping("bpm", JsonMapping.MappingType.Primitive)]
        public string Bpm { get; set; }

        [JsonMapping("title", JsonMapping.MappingType.Primitive)]
        public string Title { get; set; }

        [JsonMapping("release_year", JsonMapping.MappingType.Primitive)]
        public string ReleaseYear { get; set; }

        [JsonMapping("release_month", JsonMapping.MappingType.Primitive)]
        public string ReleaseMonth { get; set; }

        [JsonMapping("release_day", JsonMapping.MappingType.Primitive)]
        public string ReleaseDay { get; set; }

        [JsonMapping("original_format", JsonMapping.MappingType.Primitive)]
        public string OriginalFormat { get; set; }

        [JsonMapping("license", JsonMapping.MappingType.Primitive)]
        public string License { get; set; }

        [JsonMapping("uri", JsonMapping.MappingType.Primitive)]
        public string Uri { get; set; }

        [JsonMapping("permalink_url", JsonMapping.MappingType.Primitive)]
        public string PermalinkUrl { get; set; }

        [JsonMapping("artwork_url", JsonMapping.MappingType.Primitive)]
        public string Artwork { get; set; }

        [JsonMapping("waveform_url", JsonMapping.MappingType.Primitive)]
        public string WaveForm { get; set; }

        [JsonMapping("user", JsonMapping.MappingType.Class)]
        public UserSmall User { get; set; }

        [JsonMapping("stream_url", JsonMapping.MappingType.Primitive)]
        public string StreamUrl { get; set; }

        [JsonMapping("download_url", JsonMapping.MappingType.Primitive)]
        public string DownloadUrl { get; set; }

        [JsonMapping("downloads_remaining", JsonMapping.MappingType.Primitive)]
        public int DownloadsRemaining { get; set; }

        [JsonMapping("secret_token", JsonMapping.MappingType.Primitive)]
        public string SecretToken { get; set; }

        [JsonMapping("secret_uri", JsonMapping.MappingType.Primitive)]
        public string SecretUri { get; set; }

        [JsonMapping("user_playback_count", JsonMapping.MappingType.Primitive)]
        public int UserPlaybackCount { get; set; }

        [JsonMapping("user_favorite", JsonMapping.MappingType.Primitive)]
        public bool UserFavorite { get; set; }

        [JsonMapping("playback_count", JsonMapping.MappingType.Primitive)]
        public int PlaybackCount { get; set; }

        [JsonMapping("download_count", JsonMapping.MappingType.Primitive)]
        public int DownloadCount { get; set; }

        [JsonMapping("favoritings_count", JsonMapping.MappingType.Primitive)]
        public int FavoritingsCount { get; set; }

        [JsonMapping("comment_count", JsonMapping.MappingType.Primitive)]
        public int CommentsCount { get; set; }

        [JsonMapping("attachments_uri", JsonMapping.MappingType.Primitive)]
        public string AttachmentUri { get; set; }

        #endregion
    }
}
